<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数作用域</title>
</head>
<body>
    <!-- <div></div> -->
    <p id="context"></p>
    

    <script>
     const x = 1
        function a(){
            const y = 2;
            output(z)
        
        }
        function b(){
            const z = 3;
            output(y)
            
        }
        function output(val){
            const print = document.getElementById("context");
            print.textContent = `内容:${val}`

        }

    </script>
</body>
</html>
